asp截取字符串"168-178"

来源:百度知道 编辑:UC知道 时间:2024/05/25 00:27:31
在ASP中怎样把把字符串"168-178"截取.
截取后分别获得
a=168
b=178.
怎么弄啊~!!中间的"-"是固定的.数字不固定

用ASP中的Split函数

temp=Split("168-178","-")'这样会得到一人睡莲度为2的数组.

a=temp(0)
b=temp(1)
完整程序
<%
temp=Split("168-178","-")
a=temp(0)
b=temp(1)

Response.Write a&"<br>"&b
%>

s="168-178"
arr=split(s,"-")
response.write arr(0)
response.write arr(1)